<template>
    <view class="container">
		<u-navbar
			title="收银台"
			@leftClick="$u.route({
				url: 'pages_v2/center/index',
				type: 'switchTab'
			})"
			leftIconSize="44rpx"
		></u-navbar>
        <web-view :webview-styles="webviewStyles" :src="src"></web-view>
    </view>
</template>

<script>
    import { javaBaseUrl } from "@/config/config"
    var wv;
    export default {
        name: "index",
        data() {
            return {
                webviewStyles: {
                    width: '100vw',
                    height: '100vh',
                },
                src: ""
            }
        },
        onLoad(option) {
            this.src = option.url
        },
        onReady() {
            // #ifdef APP-PLUS
            var currentWebview = this.$scope.$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
            setTimeout(function() {
                wv = currentWebview.children()[0]
                wv.setStyle({top:44 + uni.getSystemInfoSync().statusBarHeight})
            }, 1000); //如果是页面初始化调用时，需要延时一下
            // #endif
        },
        methods: {
            navigateTo(path, params={}, type="switchTab") {
                uni.$u.route({
                    url: path,
                    type: type,
                    params
                })
            }
        }
    }
</script>

<style lang="scss" scoped>
    .container {
        box-sizing: border-box;
        padding-top: 30rpx;
        position: relative;
        width: 100vw;
        height: 100vh;
        .bottom {
            z-index: 999;
            position: absolute;
            box-sizing: border-box;
            width: 100%;
            padding: 0 20rpx;
            //bottom: 33rpx;
            left: 0;
			top: 0
        }
    }
</style>
